package com.mingqijia.gassafety.job.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mingqijia.gassafety.db.entity.Devicebinding;
import com.mingqijia.gassafety.db.mapper.DevicebindingMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhangfei
 * @since 2022-05-13
 */
@Service
@Slf4j
public class DevicebindingServiceImpl extends ServiceImpl<DevicebindingMapper, Devicebinding> implements IService<Devicebinding> {


    @Autowired
    private DevicebindingMapper devicebindingMapper;

    /**
     * 获取设备绑定的openId
     * @param deviceId
     * @return
     */
    public List<String> selectDevicebinding(String deviceId) {
        List<String> res = devicebindingMapper.selectDevicebinding(deviceId);
        log.info("selectDevicebinding-list:{}", JSONObject.toJSONString(res));
        return res;
    }
}
